<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/11/22 0022
  Time: 下午 4:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>新增维修记录</title>
    <link rel="stylesheet" href="/static/plugins/layui/css/layui.css">
    <style>
        .main:after{
            content: "";
            display: block;
            height: 0;
            clear:both;
            visibility: hidden;
        }
        .left{
            float: left;
            width:500px;
            margin-left: 200px;
            border:3px solid black;
            margin-top: 100px;
            height: 500px;
            padding: 50px;
        }
        .right{ margin-top: 100px;
            float: left;
            width:500px;
            padding: 50px;
            border:3px solid black;
            height: 500px;
        }
        #submit{
            margin-left: 470px;
            margin-top: 50px;
        }
        .bottom{
            border:3px solid black;
            width: 1200px;
            margin: auto;
            margin-left: 200px;

        }
    </style>
</head>
<body>
<form class="layui-form" action="/weixiu/save">
    <div class=main>
        <div class="left">
            <div class="layui-form-item ">
                <label class="layui-form-label">车辆编号</label>
                <div class="layui-input-block">
                    <select name="carId" lay-filter="aihao">
                        <c:forEach items="${cp}" var="i">
                            <option value="${i.carId}">${i.carId}</option>
                        </c:forEach>
                    </select>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">发车里程</label>
                <div class="layui-input-block">
                    <input type="text" name="initMile" required  lay-verify="required" placeholder="请输入发车里程" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">发车油量</label>
                <div class="layui-input-block">
                    <input type="text" name="initOil" required  lay-verify="required" placeholder="请输入发车油量" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">维修地点</label>
                <div class="layui-input-block">
                    <input type="text" name="repairAddress" required  lay-verify="required" placeholder="请输入维修地点" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">出车时间</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="useCarTime" id="test1" placeholder="yyyy-MM-dd">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">经办人员</label>
                <div class="layui-input-block">
                    <input type="text" name="headMan" required  lay-verify="required" placeholder="请输入经办人员" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">经办手机</label>
                <div class="layui-input-block">
                    <input type="text" name="headMobile" required  lay-verify="required" placeholder="请输入经办手机" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">维修完毕</label>
                <div class="layui-input-block">
                    <input type="checkbox" name="switch" id="aaa" lay-skin="switch" value="1">
                </div>
            </div>
        </div>
        <div class="right ">
            <div class="layui-form layui-hide">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">还车时间</label>
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" name="returnTime" id="test2" placeholder="yyyy-MM-dd">
                        </div>
                    </div>
                </div>
            </div>

            <div class="layui-form-item layui-hide">
                <label class="layui-form-label">还车里程</label>
                <div class="layui-input-block">
                    <input type="text" name="returnMile"    placeholder="请输入还车里程" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item layui-hide">
                <label class="layui-form-label">维修费用</label>
                <div class="layui-input-block">
                    <input type="text" name="repairMoney"    placeholder="请输入维修费用" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item layui-form-text layui-hide">
                <label class="layui-form-label">维修内容</label>
                <div class="layui-input-block">
                    <textarea name="repairContent" placeholder="请输入维修内容" class="layui-textarea"></textarea>
                </div>
            </div>
            <div class="layui-form-item layui-hide">
                <label class="layui-form-label">备注</label>
                <div class="layui-input-block">
                    <input type="text" name="remark"    placeholder="请输入备注" autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>

    </div>
    <div class="bottom">
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo" id="submit">增加</button>

            </div>
        </div>
    </div>





</form>
<script src="/static/plugins/jquery-3.2.1.min.js"></script>
<script src="/static/plugins/layui/layui.all.js"></script>
<script>
    //Demo
    layui.use(['form','laydate'], function(){
        var form = layui.form
        ,laydate=layui.laydate;
        //日期
        laydate.render({
            elem: '#test2'
        });
        laydate.render({
            elem: '#test1'
        });
        form.render('select')
        form.on('switch', function(data){
            if(data.elem.checked){
                $(".right div").removeClass("layui-hide")
            }else{
                $(".right div").addClass("layui-hide")
            }                           ; //开关是否开启，true或者false

        });

    });



</script>
</body>
</html>
